Skip to main content

avm.buildGenesis RPC Method

Given a JSON representation of this Virtual Machine's genesis state, create the byte representation of that state.

Updated on
Nov 2, 2023

avm.buildGenesis RPC Method

Parameters

networkID
Integer
REQUIRED
the ID of the network
genesisData
JSON
REQUIRED
A JSON representing the genesis data.
encoding
String
The encoding format. Can be either cb58 or hex. Defaults to cb58.

Returns

bytes
String
Genesis byte data
encoding
String
The encoding format to use. Can be either cb58 or hex.Defaults to cb58.
Request
1
curl --location --request POST https://docs-demo.avalanche-mainnet.quiknode.pro/ext/bc/C/rpc/ext/vm/avm \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"jsonrpc": "2.0",
5
"id" : 1,
6
"method" : "avm.buildGenesis",
7
"params" : {
8
"genesisData": {
9
"asset1": {
10
"name": "asset1",
11
"symbol":"MFCA",
12
"memo": "2Zc54v4ek37TEwu4LiV3j41PUMRd6acDDU3ZCVSxE7X",
13
"denomination": 1,
14
"initialState": {
15
"fixedCap" : [
16
{
17
"amount":100000,
18
"address": "local18jma8ppw3nhx5r4ap8clazz0dps7rv5u00z96u"
19
}
20
]
21
}
22
},
23
"asset2": {
24
"name": "asset2",
25
"symbol":"MVCA",
26
"memo": "2Zc54v4ek37TEwu4LiV3j41PUMRd6acDDU3ZCVSxE7X",
27
"denomination": 2,
28
"initialState": {
29
"variableCap" : [
30
{
31
"amount":100000,
32
"address": "local18jma8ppw3nhx5r4ap8clazz0dps7rv5u00z96u"
33
}
34
]
35
}
36
}
37
},
38
"networkId": 12345,
39
"encoding":"cb58"
40
}
41
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free