The Core API provides a powerful interface for managing blockchain resources on Kubernetes, integrating multiple functionalities into a single, cohesive experience. It is the essential tool for deploying and interacting with blockchain nodes and related services.
- MANAGEMENT OF BLOCKCHAIN RESOURCES LIKE IPFS PEERS, POLKADOT VALIDATOR NODES, CHAINLINK NODES, ETHEREUM NODES, AND MORE.
- WORKSPACE
- RBAC
- ENDPOINTS
Running the CORE API SERVER against real k8s cluster requires:
- kotal operator to be deployed in the cluster
Clone the repository and run the API server with the following command:
go run main.go
NOTE: An actual k8s cluster with kubeconfig should be available in the default directory. For testing with a mock server:
MOCK=true go run main.go
Run the API server from a Docker image with the following command:
docker run -p 3000:3000 -e MOCK=true kotalco/core-api:develop
This is a list of the environment variables you need to use the software.
SEND_GRID_API_KEY
This key is used for verifying user accountDB_SERVER_URL
postgres://postgres:secret@localhost:5432/db-name-goes-here
CORE_API_SERVER_PORT
ENVIRONMENT
could be development or productionSERVER_READ_TIMEOUT
ACCESS_SECRET
jwt symmetric key used to sign the Json Web TokenJWT_SECRET_KEY_EXPIRE_HOURS_COUNT
jwt token expiry period in hoursJWT_SECRET_KEY_EXPIRE_HOURS_COUNT_REMEMBER_ME
jwt token expiry when the user choose remomber me option with signing inDB_TESTING_SERVER_URL
DB_MAX_CONNECTIONS
DB_MAX_IDLE_CONNECTIONS
DB_MAX_LIFETIME_CONNECTIONS
VERIFICATION_TOKEN_LENGTH
the length of the verification tokens used by the system idl > 50 charsVERIFICATION_TOKEN_EXPIRY_HOURS
SEND_GRID_SENDER_NAME
the username of the emails sent to the usersSEND_GRID_SENDER_EMAIL
the email address used to send the emails with2_FACTOR_SECRET
symmetric key used to sign the user verification keyRATE_LIMITER_PER_MINUTE
Create a new node:
curl -X POST -d '{"name": "my-node", "network": "mainnet", "client": "besu"}' -H 'content-type: application/json' localhost:3000/api/v1/ethereum/nodes
Get node by name:
curl localhost:3000/api/v1/ethereum/nodes/my-node
List all nodes:
curl localhost:3000/api/v1/ethereum/nodes
Update node by name:
curl -X PUT -d '{"rpc": true}' -H 'content-type: application/json' localhost:3000/api/v1/ethereum/nodes/my-node
Delete node by name:
curl -X DELETE localhost:3000/api/v1/ethereum/nodes/my-node
The Core API is designed as a comprehensive solution for your blockchain infrastructure needs, providing streamlined management capabilities within Kubernetes environments.