FAQ

Common questions when using Phalcon Fork

How to create a Fork

Creating a Fork is straightforward. Click the button in the Fork list to create a Fork. Also, a REST API can be used to create a Fork.

How to delete a Fork

To delete a Fork, access its Settings.

Click the button to delete a Fork. Also, a REST API is available to delete a Fork.

Be cautious; deleting a Fork will remove all the data inside a Fork and cannot be recovered.

How to simulate transactions inside a Fork

Sending a transaction can be done through the GUI interface or Fork RPC.

How to get the necessary API keys and IDs for integration

When integrating Phalcon Fork into development frameworks, a couple of API keys and IDs are needed. This page shows the method to obtain such IDs.

API Key

The API key is used to verify contracts and manipulate projects and Forks. It's available in the API section of the BlockSec account.

Do NOT share this key with others.

Project ID

The project ID can be found inside the Project Setting, shown at the bottom of the project list.

Fork ID and RPC ID

The Fork ID denotes a Fork, and the RPC ID denotes the RPC used to access the Fork. They are available in Settings inside a Fork.

Fork RPC

The FORK_RPCis shown in the settings inside a Fork. It is also shown in the Fork details.

Why do I get a 'nonce too high' message

When simulating transactions inside a Fork using Foundry, it returns the 'nonce too high` error message. What should I do?

It's because the transactions sent to Fork are too fast. Add an --slow option to the command line. See the Foundry book for more information.

--slow:Makes sure a transaction is sent only after its previous one has been confirmed and succeeded.

How to debug methods invocation in Fork RPC

Sometimes, the result is unexpected when using some scripts to interact with Fork RPC. In this case, we want to debut the methods invoked on the Fork RPC and the return values.

We can use the following Python script to sit between the local script and the remote Fork RPC to see the parameters and return values.

"""
Print RPC request and response

pip3 install requests flask

How to use:
    Put Fork RPC into the TO_URL
    and change the RPC in hardhat (and other scripts) to http://127.0.0.1:12345

"""

TO_URL = "https://rpc.phalcon.blocksec.com/rpc_xxxxxx"
assert TO_URL, "Input Fork RPC to TO_URL"

import json
import requests
from flask import Flask, request, jsonify

app = Flask(__name__)


def detour(request_body):
    method = request_body['method']
    return None

@app.route("/", methods=["POST"], strict_slashes=False)
def run():
    print()
    print("--- request ---")
    request_body = request.json
    print(request_body)
    de = detour(request_body)
    if de is not None:
        print(de)
        print("------")
        return de

    print("--- response ---")
    r = requests.post(TO_URL, json=request_body)
    response_body = r.json()
    print(response_body)
    print("------")
    return jsonify(response_body)


if __name__ == "__main__":
    app.run(host="127.0.0.1", port=12345, threaded=False)

Last updated