Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/canopy-network/canopy
/ functions
Functions
5,387 in github.com/canopy-network/canopy
⨍
Functions
5,387
◇
Types & classes
860
↓ 24 callers
Function
StringToBytes
StringToBytes() converts a hexadecimal string back into a byte slice
lib/util.go:543
↓ 23 callers
Function
NewBLS12381PrivateKey
NewBLS12381PrivateKey() generates a new BLS private key
lib/crypto/bls.go:39
↓ 23 callers
Method
PoolAdd
PoolAdd() adds tokens to the Pool structure
fsm/account.go:345
↓ 23 callers
Function
TimeTrack
TimeTrack() a utility function to benchmark the time of caller function
lib/util.go:904
↓ 23 callers
Method
Warn
(msg string)
lib/log.go:35
↓ 23 callers
Function
getPassword
()
cmd/cli/admin.go:462
↓ 22 callers
Function
KeyForLockedBatch
(chainId uint64)
fsm/key.go:106
↓ 22 callers
Method
Reset
discard the underlying writer
lib/store.go:23
↓ 22 callers
Function
phaseToString
phaseToString() converts the phase object to a human-readable string
bft/bft.go:917
↓ 21 callers
Method
AddSigner
AddSigner() is used to track signers by setting a bit at the index position (from the pre-created public key list)
lib/crypto/key.go:61
↓ 21 callers
Method
GetOrder
get the order book for a specific 'chain id'
lib/consensus.go:124
↓ 21 callers
Method
HandleRemoteDexBatch
HandleRemoteDexBatch is the core function driving the DEX batch lifecycle. ───────────────────────────────────────────────────────────────────────────
fsm/dex.go:159
↓ 21 callers
Method
Inbox
Inbox() is a getter for the multiplexed stream with a specific topic
p2p/p2p.go:472
↓ 21 callers
Method
Read
Read() checks the connection for cipher data bytes, if found, the func decrypts and loads them into the 'data' buffer
p2p/encrypt.go:173
↓ 21 callers
Method
Recycle
Recycle releases a big.int to the pool
lib/crypto/classgroup.go:569
↓ 21 callers
Method
Write
Write() writes the data bytes to the encrypted connection
p2p/encrypt.go:127
↓ 20 callers
Method
Add
Add() adds a tuple to the batch verifier
lib/crypto/key_batch.go:69
↓ 20 callers
Function
NewDefaultLogger
NewDefaultLogger() creates a Logger with default settings, logging at the Debug level to stdout
lib/log.go:240
↓ 20 callers
Function
POST
(url, request, path)
cmd/rpc/web/explorer/components/api.js:44
↓ 20 callers
Function
writeTxResultToConsole
(hash *string, tx json.RawMessage, e lib.ErrorI)
cmd/cli/admin.go:398
↓ 19 callers
Method
ChangeReputation
ChangeReputation() updates the peer reputation +/- based on the int32 delta
p2p/set.go:148
↓ 19 callers
Method
EnsureNonNil
EnsureNonNil() ensures the slices in the batch are not empty NOTE: pool points is the exception because it's omitted unless remote locked batch is pul
lib/dex.go:72
↓ 19 callers
Function
NewTxn
TODO: New Txn has a lot of options, refactor the constructor to use the options pattern NewTxn() creates a new instance of Txn with the specified read
store/txn.go:85
↓ 19 callers
Method
SetDexBatch
(rootChainId, height, committee uint64, batch *lib.DexBatch)
fsm/dex_test.go:3463
↓ 19 callers
Method
SetOrder
SetOrder() sets the sell order in state
fsm/swap.go:263
↓ 19 callers
Method
txHandler
txHandler is a helper function that abstracts common workflows of sending transactions. It takes an HTTP response writer, an HTTP request, and a callb
cmd/rpc/admin.go:529
↓ 19 callers
Function
unmarshal
unmarshal reads request body and unmarshals it into ptr
cmd/rpc/server.go:415
↓ 18 callers
Method
Check
name of the message
lib/tx.go:74
↓ 18 callers
Function
NewTransaction
NewTransaction() creates a Transaction object from a message in the interface form of TransactionI
fsm/transaction.go:533
↓ 18 callers
Method
SetValidators
SetValidators() upserts multiple Validators into the state and updates the supply tracker
fsm/validator.go:131
↓ 17 callers
Method
GetAccount
* This file defines the account, pool, and supply tracker state interactions */ GetAccount() returns an Account structure for a specific address
fsm/account.go:16
↓ 17 callers
Function
NewEd25519PrivateKey
NewEd25519PrivateKey() generates a new ED25519 private key
lib/crypto/ed25519.go:28
↓ 17 callers
Function
NewVersionedStore
NewVersionedStore creates a new versioned store
store/versioned_store.go:71
↓ 17 callers
Method
Set
Set() upserts a key-value pair under a key
fsm/state.go:526
↓ 17 callers
Method
key
(prefix, param1, param2 []byte)
store/indexer.go:824
↓ 17 callers
Method
post
(routeName string, json []byte, ptr any, admin ...bool)
cmd/rpc/client.go:1084
↓ 17 callers
Function
toCNPY
(uCNPY)
cmd/rpc/web/explorer/components/util.js:9
↓ 16 callers
Function
DefaultConfig
DefaultConfig() returns a Config with developer set options
lib/config.go:47
↓ 16 callers
Function
ErrInvalidParam
(paramName string)
fsm/error.go:166
↓ 16 callers
Method
IsEmpty
IsEmpty() checks if a locked dex batch is 'logically' empty or not
lib/dex.go:63
↓ 16 callers
Method
PublicKey
PublicKey() returns the individual public key that pairs with this BLS private key for basic signature verification
lib/crypto/bls.go:92
↓ 16 callers
Method
RevIterator
iterate through the data one KV pair at a time in lexicographical order
lib/store.go:93
↓ 16 callers
Method
Sign
(msg []byte)
lib/crypto/key.go:31
↓ 16 callers
Function
file_message_proto_rawDescGZIP
()
fsm/message.pb.go:1367
↓ 16 callers
Function
getFrom
(address, nickname string)
cmd/rpc/client.go:511
↓ 16 callers
Method
transactionRequest
(routeName string, txRequest any, submit bool)
cmd/rpc/client.go:928
↓ 15 callers
Method
SignBytes
()
lib/tx.go:437
↓ 15 callers
Method
VerifyBytes
VerifyBytes() verifies a digital signature from its corresponding private key
lib/crypto/key.go:17
↓ 15 callers
Function
bulkSetPrefixedKV
bulkSetPrefixedKV sets multiple single segment length prefixed key-value pairs in the store
store/store_test.go:155
↓ 15 callers
Method
view
view() creates a standardized view for consensus module testing - required phase param to set the phase in the view - optional round param, as most te
bft/mock_test.go:466
↓ 14 callers
Method
Add
Add() adds a GovProposalWithVote to the list
fsm/gov_params.go:697
↓ 14 callers
Function
BytesToBLS12381Point
BytesToBLS12381Point() creates a new G1 point on BLS12-381 curve which is the public key of the pair
lib/crypto/bls.go:172
↓ 14 callers
Method
GetCommitteeMembers
GetCommitteeMembers() retrieves the ValidatorSet that is responsible for the 'chainId'
fsm/committee.go:246
↓ 14 callers
Function
MarshalJSONIndentString
MarshalJSONIndentString() serializes a message into an indented JSON string
lib/util.go:472
↓ 14 callers
Function
NewError
(code: number, module: string, message: string)
plugin/typescript/src/contract/error.ts:15
↓ 14 callers
Function
NewError
NewError() creates a plugin error
plugin/go/contract/error.go:13
↓ 14 callers
Function
NewValidatorSet
NewValidatorSet() initializes a ValidatorSet from a given set of consensus validators
lib/consensus.go:25
↓ 14 callers
Method
SetUint64
SetString() update a string parameter in the structure
fsm/gov_params.go:36
↓ 14 callers
Method
counterId
()
fsm/dex_test.go:2790
↓ 14 callers
Method
encodeBigEndian
encodeBigEndian() encodes a number such that default DB order (lexicographical) will sort properly when iterating by height
store/indexer.go:830
↓ 14 callers
Function
getAccountBalance
Helper functions
fsm/dex_test.go:3424
↓ 14 callers
Method
heightRequest
(routeName string, height uint64, ptr any)
cmd/rpc/client.go:999
↓ 13 callers
Method
CheckBasic
VIEW CODE BELOW
lib/consensus.go:469
↓ 13 callers
Method
Get
Get() retrieves a key-value pair under a key NOTE: returns (nil, nil) if no value is found for that key
fsm/state.go:530
↓ 13 callers
Method
GetParams
GetParams() returns the aggregated ParamSpaces in a single Params object
fsm/gov.go:277
↓ 13 callers
Method
Multiply
Multiply performs multiplication of two elements from the class group and returns the resulting class group element NOTE: this function re-uses big.in
lib/crypto/classgroup.go:68
↓ 13 callers
Method
SetParams
SetParams() writes an entire Params object into state
fsm/gov.go:226
↓ 13 callers
Function
file_event_proto_rawDescGZIP
()
lib/event.pb.go:1098
↓ 13 callers
Function
msg
(t *testing.T, msg lib.MessageI)
fsm/ethereum_test.go:686
↓ 13 callers
Function
newNodeKey
newNodeKey() given data and a bitCount, this function treats bytes like a continuous bit string a) it truncates the bits beyond bitcount b) it stores
store/smt.go:868
↓ 13 callers
Function
newTestKeyGroup
(t *testing.T, variation ...int)
fsm/state_test.go:380
↓ 13 callers
Function
pack
pack() is a helper function for packing ABI arguments
cmd/rpc/eth.go:1397
↓ 12 callers
Method
Delete
Delete() deletes a key-value pair under a key
fsm/state.go:533
↓ 12 callers
Method
GetParamsCons
GetParamsCons() returns the current state of the governance params in the Consensus space
fsm/gov.go:309
↓ 12 callers
Method
GetPointsFor
GetPointsFor() returns the amount of points an address has
fsm/account.go:751
↓ 12 callers
Method
GetRootChainId
GetRootChainId() gets the latest root chain id from the state
fsm/gov.go:542
↓ 12 callers
Method
GetValidator
* This file implements state actions on Validators and Delegators*/ GetValidator() gets the validator from the store via the address
fsm/validator.go:16
↓ 12 callers
Function
KeyForNextBatch
(chainId uint64)
fsm/key.go:110
↓ 12 callers
Method
Name
new instance of the message type
lib/tx.go:73
↓ 12 callers
Method
SaveToFile
SaveToFile() persists the polls object to a json file
fsm/gov_params.go:557
↓ 12 callers
Method
SetParamsVal
SetParamsVal() sets Validator params into state
fsm/gov.go:249
↓ 12 callers
Function
Uint64ReducePercentage
Uint64ReducePercentage() reduces an amount by a specified percentage
lib/util.go:630
↓ 12 callers
Method
addEvent
addEvent() is a helper function that creates an event with common fields set and adds it to the tracker
fsm/event.go:94
↓ 12 callers
Function
checkAddress
checkAddress() validates the address in the Message
fsm/message_helpers.go:886
↓ 12 callers
Function
file_certificate_proto_rawDescGZIP
()
lib/certificate.pb.go:951
↓ 12 callers
Function
getPaginatedArgs
()
cmd/cli/query.go:467
↓ 12 callers
Function
h3x
(t *testing.T, s string)
fsm/ethereum_test.go:692
↓ 11 callers
Method
AccountSub
AccountSub() removes tokens from an Account
fsm/account.go:147
↓ 11 callers
Method
Found
Found() checks for an existing entry and adds it to the map if it's not present
lib/util.go:885
↓ 11 callers
Method
GetPeerInfo
GetPeerInfo() returns a copy of the authenticated information from the peer structure
p2p/set.go:172
↓ 11 callers
Method
GetRandom
GetRandom() returns a random peer from the Book that has a specific chain in the Meta
p2p/book.go:265
↓ 11 callers
Method
Iterator
Iterator() creates and returns an iterator for the state machine's underlying store starting at the specified key and iterating lexicographically
fsm/state.go:537
↓ 11 callers
Method
Less
Less() returns true if this View is less than the parameter View
lib/consensus.go:568
↓ 11 callers
Method
Pow
Pow() executes an exponential function (group^n) on a class group and returns the resulting class group
lib/crypto/classgroup.go:144
↓ 11 callers
Method
RoundInterrupt
RoundInterrupt() begins the ROUND-INTERRUPT phase after any phase errors ROUND-INTERRUPT: - Replica sends current View message to other replicas (Pace
bft/bft.go:530
↓ 11 callers
Method
SetAccount
SetAccount() upserts an account into the state
fsm/account.go:84
↓ 11 callers
Method
ToString
ToString() returns the log string format of View
lib/consensus.go:618
↓ 11 callers
Function
UnmarshalJSON
UnmarshalJSON() deserializes a JSON byte slice into the specified object
lib/util.go:448
↓ 11 callers
Method
UpdateParam
PARAMETER CODE BELOW UpdateParam() updates a governance parameter keyed by space and name
fsm/gov.go:53
↓ 11 callers
Function
convertNumber
(nString, cutoff = 1000000, convertToCNPY = false)
cmd/rpc/web/explorer/components/util.js:24
← previous
next →
101–200 of 5,387, ranked by callers